<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<?xml version="1.0" encoding="UTF-8"?>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page session="true"%>
<%@ page isELIgnored="false"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Авторизация</title>
<style>
.error {
	padding: 15px;
	margin-bottom: 20px;
	border: 1px solid transparent;
	border-radius: 4px;
	color: #a94442;
	background-color: #f2dede;
	border-color: #ebccd1;
}

.msg {
	padding: 15px;
	margin-bottom: 20px;
	border: 1px solid transparent;
	border-radius: 4px;
	color: #31708f;
	background-color: #d9edf7;
	border-color: #bce8f1;
}

#login-box {
	width: 300px;
	padding: 20px;
	margin: 100px auto;
	background: #fff;
	-webkit-border-radius: 2px;
	-moz-border-radius: 2px;
	border: 1px solid #000;
}
</style>
</head>


<div id="login-box">

	<h2>Авторизация</h2>

	<c:if test="${not empty fail}">
		<div class="error">Неверный логин/пароль</div>
	</c:if>

	<form name='loginForm' action="<c:url value='login'/>" method='POST'>
		<table>
			<tr>
				<td>Логин:</td>
				<td><input type='text' name='j_username' id="j_username"></td>
			</tr>
			<tr>
				<td>Пароль:</td>
				<td><input type='password' name='j_password' id="j_password" /></td>
			</tr>
			<tr>
				<td colspan='2'><input name="signin" type="submit" value="Вход" /></td>
			</tr>
			<tr>
				<td colspan='2'><a href="<c:url value="register"/>">Регистрация</a></td>
			</tr>
		</table>
		<input type="hidden" name="${_csrf.parameterName}"
			value="${_csrf.token}" />
	</form>
</div>

</body>
</html>